package com.gitee.wsl.struct.either

import arrow.core.EitherNel
import arrow.core.NonEmptyList


// helper functions for validated
fun <E, A> EitherNel<E, A>.getOrThrow(): A = fold({ error(it) }, { it })

fun <E, A> EitherNel<E, A>.getErrorsOrThrow(): NonEmptyList<E> = fold({ it }, { error(it.toString()) })
